package com.lhy.controller;

import com.lhy.service.EchartsService;
import com.mongodb.client.gridfs.GridFSFindIterable;
import com.mongodb.client.gridfs.model.GridFSFile;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/echarts")
public class EchartsController {

    @Resource
    private EchartsService echartsService;

    //气体浓度表
    @GetMapping("/line")
    public Map<String,Object> line(){

        return echartsService.selectAll();
    }

    //用户权限表
    @GetMapping("/bar")
    public Map<String,Object> bar(){
        return echartsService.bar();
    }

    //矿工工种表
    @GetMapping("/miner")
    public Map<String,Object> miner(){
        return echartsService.miner();
    }

    //设备状态表
    @GetMapping("/devices")
    public Map<String,Object> devices(){
        return echartsService.devices();
    }

    //瓦斯含量表
    @GetMapping("/gas")
    public Map<String,Object> gas(){
        return echartsService.gas();
    }

    @GetMapping("/tone")
    public GridFSFile findOne(){
        return echartsService.findOne();
    }

}
